open(BUFF,"human_refflat_table1");
$line = <BUFF>;
$line = <BUFF>;
chomp($line);
@array = split(/\t/,$line);
 @start = split(',',$array[9]);
                        @stop = split(',',$array[10]);
                        $prev_stop = "";
                        for($i=0;$i<@stop;$i++)
                        {
                                if($prev_stop ne "")
                                {
                                        $pprev = $prev_stop+1;
                                        $pos[$k] = $pprev;
                                        $pstart = $start[$i]-1;
                                        $whole[$k] = $array[0]."_intron"."\t".$pprev."\t".$pstart;
                                        $k++;
                                }
                                $pos[$k] = $start[$i];
                                $whole[$k] = $array[0]."_exon"."\t".$start[$i]."\t".$stop[$i];
                                $k++;
                                $prev_stop = $stop[$i];
                        }


print "@pos\n@whole\n";
